const data = {
  isCreateFolderEnable: false,
  openedFolder: [],
}

const mutations = {
  /**
   * 设置是否新建文件夹
   * @param state
   * @param isCreateFolderEnable
   * @constructor
   */
  SET_IS_CREATE_FOLDER_ENABLE(state, isCreateFolderEnable) {
    state.isCreateFolderEnable = isCreateFolderEnable
  },
  SET_OPENED_FOLDER(state, openedFolder) {
    state.openedFolder = openedFolder
  },
}

const actions = {
  /**
   * 设置新建文件夹状态为激活
   * @param commit
   */
  setIsCreateFolderActivated({ commit }) {
    commit('SET_IS_CREATE_FOLDER_ENABLE', true)
  },

  /**
   * 设置新建文件夹状态为禁用
   * @param commit
   */
  setIsCreateFolderDisabled({ commit }) {
    commit('SET_IS_CREATE_FOLDER_ENABLE', false)
  },
}

export default {
  namespaced: true,
  state: data,
  mutations,
  actions,
}
